
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>定时器简单中断程序 · STM32HAL系列教程</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Atonidas">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-theme-lou/lou.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="硬件PWM输出.html" />
    
    
    <link rel="prev" href="./" />
    

    </head>
    <body>
         

<div class="book">
  <div class="header-inner">
    <!-- LOGO -->
    <div class="logo"></div>
    <span class="title"></span>

    <!-- Search -->
    
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>


    <!-- Nav -->
    <ul class="header-nav">
      <li>
        <a href="https://Gitee.com/atonidas" target="_blank">Gitee</a>
      </li>
    </ul>
  </div>

  <div class="book-summary">
    <div class="book-summary-title">文档目录</div>
     
    <nav role="navigation">


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../软件环境/">
            
                <a href="../软件环境/">
            
                    
                    软件环境
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../软件环境/VScode的使用.html">
            
                <a href="../软件环境/VScode的使用.html">
            
                    
                    VScode快速入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../软件环境/VSCode插件分享.html">
            
                <a href="../软件环境/VSCode插件分享.html">
            
                    
                    VScode插件分享
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../软件环境/CubeMX简介.html">
            
                <a href="../软件环境/CubeMX简介.html">
            
                    
                    CubeMX简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../软件环境/创建一个工程.html">
            
                <a href="../软件环境/创建一个工程.html">
            
                    
                    创建一个工程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../软件环境/Git版本管理.html">
            
                <a href="../软件环境/Git版本管理.html">
            
                    
                    Git版本管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="../软件环境/创建一个快速开发模板.html">
            
                <a href="../软件环境/创建一个快速开发模板.html">
            
                    
                    创建一个快速开发模板
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../STM32的IO口/">
            
                <a href="../STM32的IO口/">
            
                    
                    STM32的IO口
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../STM32的IO口/点亮一个LED.html">
            
                <a href="../STM32的IO口/点亮一个LED.html">
            
                    
                    点亮一个LED
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../STM32的IO口/使用独立按键.html">
            
                <a href="../STM32的IO口/使用独立按键.html">
            
                    
                    使用独立按键
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../STM32中断/">
            
                <a href="../STM32中断/">
            
                    
                    STM32中断
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../STM32中断/CubeMX外部中断配置.html">
            
                <a href="../STM32中断/CubeMX外部中断配置.html">
            
                    
                    CubeMX外部中断配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../STM32中断/HAL库外部中断程序.html">
            
                <a href="../STM32中断/HAL库外部中断程序.html">
            
                    
                    HAL库外部中断程序
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="./">
            
                <a href="./">
            
                    
                    STM32定时器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.5.1" data-path="定时器简单中断程序.html">
            
                <a href="定时器简单中断程序.html">
            
                    
                    定时器简单中断程序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="硬件PWM输出.html">
            
                <a href="硬件PWM输出.html">
            
                    
                    硬件PWM输出
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="DMA输出PWM控制WS2812.html">
            
                <a href="DMA输出PWM控制WS2812.html">
            
                    
                    DMA输出PWM控制WS2812
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../STM32串口/">
            
                <a href="../STM32串口/">
            
                    
                    STM32串口
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../STM32串口/串口发送及中断接收.html">
            
                <a href="../STM32串口/串口发送及中断接收.html">
            
                    
                    串口发送及中断接收
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../STM32串口/串口的格式化输出.html">
            
                <a href="../STM32串口/串口的格式化输出.html">
            
                    
                    串口的格式化输出
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../STM32串口/串口DMA传输.html">
            
                <a href="../STM32串口/串口DMA传输.html">
            
                    
                    串口DMA传输
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../STM32串口/简单协议编写.html">
            
                <a href="../STM32串口/简单协议编写.html">
            
                    
                    简单协议编写
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../SPI协议/">
            
                <a href="../SPI协议/">
            
                    
                    SPI协议
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../SPI协议/CubeMX配置及主要函数.html">
            
                <a href="../SPI协议/CubeMX配置及主要函数.html">
            
                    
                    CubeMX配置及主要参数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../SPI协议/OLED驱动移植.html">
            
                <a href="../SPI协议/OLED驱动移植.html">
            
                    
                    OLED驱动移植
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../SPI协议/LVGL移植显示.html">
            
                <a href="../SPI协议/LVGL移植显示.html">
            
                    
                    LVGL移植显示
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../SPI协议/Flash的使用及文件系统.html">
            
                <a href="../SPI协议/Flash的使用及文件系统.html">
            
                    
                    Flash的使用及文件系统
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../ADC的使用/">
            
                <a href="../ADC的使用/">
            
                    
                    ADC的使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../ADC的使用/CubeMX中ADC配置概览.html">
            
                <a href="../ADC的使用/CubeMX中ADC配置概览.html">
            
                    
                    CubeMX中ADC配置概览
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../ADC的使用/查询阻塞方式.html">
            
                <a href="../ADC的使用/查询阻塞方式.html">
            
                    
                    查询阻塞方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../ADC的使用/中断方式.html">
            
                <a href="../ADC的使用/中断方式.html">
            
                    
                    中断方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../ADC的使用/DMA方式.html">
            
                <a href="../ADC的使用/DMA方式.html">
            
                    
                    DMA方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../ADC的使用/应用示例.html">
            
                <a href="../ADC的使用/应用示例.html">
            
                    
                    应用示例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../其他代码整合搬运/">
            
                <a href="../其他代码整合搬运/">
            
                    
                    其他代码整合搬运
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../其他代码整合搬运/MultiButton.html">
            
                <a href="../其他代码整合搬运/MultiButton.html">
            
                    
                    MultiButton
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../其他代码整合搬运/EasyLogger.html">
            
                <a href="../其他代码整合搬运/EasyLogger.html">
            
                    
                    EasyLogger
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../其他代码整合搬运/letter-shell.html">
            
                <a href="../其他代码整合搬运/letter-shell.html">
            
                    
                    letter-shell
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../其他代码整合搬运/EasyFlash.html">
            
                <a href="../其他代码整合搬运/EasyFlash.html">
            
                    
                    EasyFlash
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.5" data-path="../其他代码整合搬运/时间片调度.html">
            
                <a href="../其他代码整合搬运/时间片调度.html">
            
                    
                    时间片调度
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../加入我们/">
            
                <a href="../加入我们/">
            
                    
                    加入我们
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../加入我们/Gitbook环境.html">
            
                <a href="../加入我们/Gitbook环境.html">
            
                    
                    Gitbook环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../加入我们/Markdown语法简介.html">
            
                <a href="../加入我们/Markdown语法简介.html">
            
                    
                    Markdown语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../加入我们/编辑器推荐.html">
            
                <a href="../加入我们/编辑器推荐.html">
            
                    
                    编辑器推荐
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../加入我们/工程文件说明.html">
            
                <a href="../加入我们/工程文件说明.html">
            
                    
                    工程文件说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" data-path="../加入我们/提交注意事项.html">
            
                <a href="../加入我们/提交注意事项.html">
            
                    
                    提交注意事项
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>

</nav>
     
  </div>

  <!-- Content nav -->
  <div class="book-anchor">
    <div class="book-anchor-title"></div>

    <div class="book-anchor-body"></div>
  </div>

  <div class="book-body">
    
    <div class="body-inner">
       

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >定时器简单中断程序</a>
    </h1>
</div>



      <div class="page-wrapper" tabindex="-1" role="main">
        <div class="page-inner">
          
<div id="book-search-results">
    <div class="search-noresults">
    
          <section class="normal markdown-section">
             <h1 id="cubemx-&#x914D;&#x7F6E;&#x5B9A;&#x65F6;&#x5668;&#x4E2D;&#x65AD;">CubeMX &#x914D;&#x7F6E;&#x5B9A;&#x65F6;&#x5668;&#x4E2D;&#x65AD;</h1>
<blockquote>
<p>&#x5728; CubeMX &#x4E2D;&#xFF0C;&#x5DE6;&#x4FA7;&#x6709;&#x4E13;&#x95E8;&#x7684;&#x4E00;&#x680F; TIM &#x7528;&#x4E8E;&#x914D;&#x7F6E;&#x5B9A;&#x65F6;&#x5668;&#x7684;&#x5404;&#x4E2A;&#x529F;&#x80FD;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x53EF;&#x89C6;&#x5316;&#x7684;&#x65B9;&#x5F0F;&#x914D;&#x7F6E;&#x5B9A;&#x65F6;&#x5668;</p>
</blockquote>
<p>&#x6211;&#x4EEC;&#x4EE5;<strong>&#x8BBE;&#x5B9A;&#x4E00;&#x4E2A; 1ms &#x7684;&#x4E2D;&#x65AD;</strong>&#x4E3A;&#x76EE;&#x6807;&#xFF0C;&#x7B80;&#x5355;&#x914D;&#x7F6E;&#x5B9A;&#x65F6;&#x5668;&#x4E2D;&#x65AD;&#xFF0C;&#x5728;&#x4E2D;&#x65AD;&#x4E2D;&#x8BA1;&#x6570;&#x5B9E;&#x73B0; LED &#x95EA;&#x70C1;,&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x539F;&#x672C;&#x5B8C;&#x6210;&#x4E86; GPIO &#x5E94;&#x7528;&#x53CA; Led_Tick()&#x7A0B;&#x5E8F;&#x7684;&#x5DE5;&#x7A0B;&#x9879;&#x76EE;&#xFF0C;&#x8282;&#x7701;&#x914D;&#x7F6E;&#x65F6;&#x95F4;</p>
<p>&#x914D;&#x7F6E;&#x65F6;&#x949F;&#x6811;&#x548C; LED &#x7684; GPIO &#x53E3;&#x672C;&#x6587;&#x4E0D;&#x518D;&#x8D58;&#x8FF0;&#xFF0C;&#x5B8C;&#x6210;&#x8FD9;&#x4E9B;&#x57FA;&#x672C;&#x914D;&#x7F6E;&#x540E;&#xFF0C;&#x9009;&#x62E9;&#x4E00;&#x4E2A;&#x5B9A;&#x65F6;&#x5668;&#xFF0C;&#x914D;&#x7F6E;&#x5176;&#x65F6;&#x949F;&#x6E90;&#x4E3A;&#x5185;&#x90E8;&#x65F6;&#x949F;&#x6E90;<strong>Internal Clock</strong>&#xFF0C;&#x9664;&#x6B64;&#x5916;&#x8FD8;&#x6709;&#x5916;&#x90E8;&#x65F6;&#x949F;&#x6E90;<strong>ETR2</strong>&#xFF0C;&#x901A;&#x5E38;&#x7528;&#x4E8E;&#x8BA1;&#x6570;&#x6A21;&#x5F0F;
<img src="assets/&#x5B9A;&#x65F6;&#x5668;&#x65F6;&#x949F;&#x6E90;.png" alt="&#x5B9A;&#x65F6;&#x5668;&#x65F6;&#x949F;&#x6E90;"></p>
<p>&#x4E4B;&#x540E;&#x5728;&#x53C2;&#x6570;<strong>Parameter</strong>&#x4E2D;&#x914D;&#x7F6E;&#x5206;&#x9891;&#x6570;&#x548C;&#x6700;&#x5927;&#x8BA1;&#x6570;&#x5468;&#x671F;&#x7B49;&#x53C2;&#x6570;&#xFF1A;
<img src="assets/&#x5B9A;&#x65F6;&#x5668;&#x53C2;&#x6570;.png" alt="&#x5B9A;&#x65F6;&#x5668;&#x53C2;&#x6570;"></p>
<p>&#x6240;&#x7528;&#x5230;&#x53C2;&#x6570;&#x542B;&#x4E49;&#x5982;&#x4E0B;&#x8868;&#x683C;</p>
<table>
<thead>
<tr>
<th style="text-align:left">&#x53C2;&#x6570;</th>
<th>&#x542B;&#x4E49;</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">&#x65F6;&#x949F;&#x5206;&#x9891;&#x6570;</td>
<td>&#x8BBE;&#x5B9A;&#x65F6;&#x949F;&#x9891;&#x7387;&#x5206;&#x9891;&#xFF1B;&#x6B64;&#x5904;&#x5C06; 84MHz &#x7684;&#x65F6;&#x949F;&#x5206;&#x9891;&#x5230; 1MHz</td>
</tr>
<tr>
<td style="text-align:left">&#x8BA1;&#x6570;&#x6A21;&#x5F0F;</td>
<td>&#x8BBE;&#x5B9A;&#x5411;&#x4E0A;&#x8BA1;&#x6570;&#x3001;&#x5411;&#x4E0B;&#x8BA1;&#x6570;&#x3001;&#x4E2D;&#x5FC3;&#x8BA1;&#x6570;&#xFF1B;&#x6B64;&#x5904;&#x9009;&#x62E9;&#x5411;&#x4E0A;&#x8BA1;&#x6570;</td>
</tr>
<tr>
<td style="text-align:left">&#x8BA1;&#x6570;&#x5468;&#x671F;</td>
<td>&#x8BBE;&#x5B9A;&#x5355;&#x4E2A;&#x5468;&#x671F;&#x8BA1;&#x6570;&#x4E2A;&#x6570;&#xFF1B;&#x6B64;&#x5904;&#x8BB0;&#x5F55; 1000 &#x4E2A;&#xFF0C;&#x8BA1;&#x6570;&#x9891;&#x7387; 1MHz&#xFF0C;&#x5B9E;&#x73B0; 1ms</td>
</tr>
<tr>
<td style="text-align:left">&#x65F6;&#x949F;&#x5206;&#x9891;&#x56E0;&#x5B50;</td>
<td>&#x5728;&#x65F6;&#x949F;&#x5206;&#x9891;&#x7684;&#x57FA;&#x7840;&#x4E0A;&#x53EF;&#x4EE5;&#x518D;&#x8BBE;&#x5B9A; 0/2/4 &#x5206;&#x9891;&#xFF1B;&#x6B64;&#x5904;&#x4E0D;&#x5206;</td>
</tr>
<tr>
<td style="text-align:left">&#x91CD;&#x590D;&#x8BA1;&#x6570;&#x6B21;&#x6570;</td>
<td>&#x8BBE;&#x5B9A;&#x989D;&#x5916;&#x6EA2;&#x51FA;&#x591A;&#x5C11;&#x6B21;&#x540E;&#x8FDB;&#x5165;&#x4E2D;&#x65AD;&#xFF1B;&#x8BBE;&#x7F6E;&#x4E3A; 0 &#x65F6;&#x6EA2;&#x51FA;&#x540E;&#x8FDB;&#x5165;&#x4E2D;&#x65AD;</td>
</tr>
<tr>
<td style="text-align:left">&#x81EA;&#x52A8;&#x91CD;&#x88C5;&#x8F7D;</td>
<td>&#x662F;&#x5426;&#x5F00;&#x542F;&#x81EA;&#x52A8;&#x91CD;&#x88C5;&#xFF1B;&#x5F00;&#x542F;</td>
</tr>
</tbody>
</table>
<p>&#x800C;&#x5206;&#x9891;&#x524D;&#x7684;&#x9891;&#x7387;&#x53EF;&#x4EE5;&#x5728;&#x65F6;&#x949F;&#x6811;&#x7684;&#x6700;&#x53F3;&#x4FA7;&#x770B;&#x5230;&#xFF0C;&#x56E0;&#x4E3A;&#x9009;&#x7528;&#x7684;&#x5B9A;&#x65F6;&#x5668;&#x662F; TIM1,&#x4E3A;&#x9AD8;&#x7EA7;&#x5B9A;&#x65F6;&#x5668;&#xFF0C;&#x6302;&#x5728; APB2 &#x4E0B;&#xFF0C;&#x4E3A; 84MHz
<img src="assets/&#x65F6;&#x949F;&#x6E90;&#x9891;&#x7387;.png" alt="&#x65F6;&#x949F;&#x6E90;&#x9891;&#x7387;"></p>
<p>&#x5728;&#x5B9A;&#x65F6;&#x5668;&#x7684; NVIC &#x8BBE;&#x7F6E;&#x4E2D;&#xFF0C;&#x4E2D;&#x65AD;&#x65B9;&#x5F0F;&#x9009;&#x62E9;&#x5B9A;&#x65F6;&#x5668;&#x66F4;&#x65B0;&#x4E2D;&#x65AD;
<img src="assets/&#x5B9A;&#x65F6;&#x5668;&#x4E2D;&#x65AD;&#x65B9;&#x5F0F;.png" alt="&#x5B9A;&#x65F6;&#x5668;&#x4E2D;&#x65AD;&#x65B9;&#x5F0F;"></p>
<p>&#x5230;&#x6B64;&#xFF0C;&#x5B9A;&#x65F6;&#x5668;&#x4E2D;&#x65AD;&#x914D;&#x7F6E;&#x5B8C;&#x6210;&#xFF0C;&#x914D;&#x7F6E;&#x5DE5;&#x7A0B;&#x540E;&#x751F;&#x6210;&#x4EE3;&#x7801;&#x5F00;&#x59CB;&#x7F16;&#x5199;&#x7A0B;&#x5E8F;&#x90E8;&#x5206;</p>
<h1 id="&#x5B9A;&#x65F6;&#x5668;&#x4E2D;&#x65AD;&#x7A0B;&#x5E8F;">&#x5B9A;&#x65F6;&#x5668;&#x4E2D;&#x65AD;&#x7A0B;&#x5E8F;</h1>
<h2 id="&#x90E8;&#x5206;&#x7A0B;&#x5E8F;&#x4ECB;&#x7ECD;">&#x90E8;&#x5206;&#x7A0B;&#x5E8F;&#x4ECB;&#x7ECD;</h2>
<p>&#x6253;&#x5F00;&#x7A0B;&#x5E8F;&#xFF0C;&#x4E3B;&#x51FD;&#x6570;&#x4E2D;&#x591A;&#x4E86;&#x5B9A;&#x65F6;&#x5668;&#x7684;&#x521D;&#x59CB;&#x5316;<code>MX_TIM1_Init();</code>&#x5176;&#x5185;&#x90E8;&#x90E8;&#x5206;&#x5185;&#x5BB9;&#x4E3A;&#xFF1A;</p>
<pre><code class="lang-c"> <span class="hljs-comment">/* USER CODE END TIM1_Init 1 */</span>
  htim1.Instance = TIM1;
  htim1.Init.Prescaler = <span class="hljs-number">84</span> <span class="hljs-number">-1</span> ;
  htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
  htim1.Init.Period = <span class="hljs-number">1000</span> - <span class="hljs-number">1</span>;
  htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
  htim1.Init.RepetitionCounter = <span class="hljs-number">0</span>;
  htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE;
  <span class="hljs-keyword">if</span> (HAL_TIM_Base_Init(&amp;htim1) != HAL_OK)
  {
    Error_Handler();
  }
</code></pre>
<p>&#x53EF;&#x4EE5;&#x770B;&#x51FA;&#x4E4B;&#x524D;CubeMX&#x4E2D;&#x7684;&#x914D;&#x7F6E;&#x5DF2;&#x7ECF;&#x751F;&#x6210;&#x7531;&#x7ED3;&#x6784;&#x4F53;&#x65B9;&#x5F0F;&#x914D;&#x7F6E;&#x7684;&#x7A0B;&#x5E8F;&#x8BED;&#x53E5;
&#x800C;&#x6253;&#x5F00;<code>stm32f4xx_it.c</code>&#x4E2D;&#x627E;&#x5230;<code>HAL_TIM_IRQHandler(&amp;htim1)</code>&#x5E76;&#x8DF3;&#x8F6C;&#x8FDB;&#x53BB;&#x540E;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#xFF0C;&#x5B9A;&#x65F6;&#x5668;&#x7684;&#x4E2D;&#x65AD;&#x51FD;&#x6570;&#x4E5F;&#x662F;&#x7C7B;&#x4F3C;&#x5916;&#x90E8;&#x4E2D;&#x65AD;&#x7684;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x3002;&#x8FD9;&#x6BB5;&#x4EE3;&#x7801;&#x5305;&#x542B;&#x4E86;&#x5404;&#x79CD;&#x5B9A;&#x65F6;&#x5668;&#x4E2D;&#x65AD;&#x7684;&#x56DE;&#x8C03;&#x5904;&#x7406;&#x8F83;&#x4E3A;&#x590D;&#x6742;&#xFF0C;&#x9009;&#x62E9;<strong>&#x5B9A;&#x65F6;&#x5668;&#x66F4;&#x65B0;&#x4E2D;&#x65AD;</strong>&#x65F6;&#xFF0C;&#x8FDB;&#x5165;&#x4E2D;&#x65AD;&#x751F;&#x6548;&#x7684;&#x662F;&#x5982;&#x4E0B;&#x7A0B;&#x5E8F;&#x6BB5;&#xFF1A;</p>
<pre><code class="lang-c">  <span class="hljs-keyword">if</span> (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_UPDATE) != RESET)
  {
    <span class="hljs-keyword">if</span> (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_UPDATE) != RESET)
    {
      __HAL_TIM_CLEAR_IT(htim, TIM_IT_UPDATE);
<span class="hljs-meta">#<span class="hljs-meta-keyword">if</span> (USE_HAL_TIM_REGISTER_CALLBACKS == 1)</span>
      htim-&gt;PeriodElapsedCallback(htim);
<span class="hljs-meta">#<span class="hljs-meta-keyword">else</span></span>
      HAL_TIM_PeriodElapsedCallback(htim);
<span class="hljs-meta">#<span class="hljs-meta-keyword">endif</span> <span class="hljs-comment">/* USE_HAL_TIM_REGISTER_CALLBACKS */</span></span>
    }
  }
</code></pre>
<h2 id="&#x4E2D;&#x65AD;&#x7A0B;&#x5E8F;&#x7F16;&#x5199;">&#x4E2D;&#x65AD;&#x7A0B;&#x5E8F;&#x7F16;&#x5199;</h2>
<p>&#x5148;&#x5728;&#x4E3B;&#x7A0B;&#x5E8F;while&#x5FAA;&#x73AF;&#x5F00;&#x59CB;&#x524D;&#x6DFB;&#x52A0;&#x5982;&#x4E0B;&#x8BED;&#x53E5;&#xFF1A;</p>
<pre><code class="lang-c">  <span class="hljs-comment">/* USER CODE BEGIN 2 */</span>
    <span class="hljs-comment">/*&#x5F00;&#x59CB;&#x5B9A;&#x65F6;&#x5668;&#x4E2D;&#x65AD;*/</span>
    HAL_TIM_Base_Start_IT(&amp;htim1);
  <span class="hljs-comment">/* USER CODE END 2 */</span>
</code></pre>
<p>&#x4E4B;&#x540E;&#x5C06;&#x4E4B;&#x524D;&#x4E3B;&#x51FD;&#x6570;&#x4E2D;&#x7684;<code>Led_Tick()</code>&#x7B49;&#x8BED;&#x53E5;&#x6CE8;&#x91CA;&#xFF0C;&#x53EA;&#x4FDD;&#x7559;&#x5EF6;&#x65F6;</p>
<pre><code class="lang-c">  <span class="hljs-keyword">while</span> (<span class="hljs-number">1</span>)
  {
    HAL_Delay(<span class="hljs-number">5</span>);
    <span class="hljs-comment">// Led_Tick();</span>
    <span class="hljs-comment">/* USER CODE END WHILE */</span>
    <span class="hljs-comment">/* USER CODE BEGIN 3 */</span>
  }
</code></pre>
<p>&#x6700;&#x540E;&#x5728;&#x4E3B;&#x7A0B;&#x5E8F;&#x4E0B;&#x65B9;&#x6DFB;&#x52A0;&#x5B9A;&#x65F6;&#x5668;&#x4E2D;&#x65AD;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#xFF0C;&#x52A0;&#x5165;&#x5B9A;&#x65F6;&#x95EA;&#x706F;&#x7A0B;&#x5E8F;</p>
<pre><code class="lang-c"><span class="hljs-comment">/* USER CODE BEGIN 4 */</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> LED_ITV_TIME 500</span>
<span class="hljs-keyword">static</span> <span class="hljs-keyword">uint16_t</span> LedTimer = LED_ITV_TIME;
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">HAL_TIM_PeriodElapsedCallback</span><span class="hljs-params">(TIM_HandleTypeDef *htim)</span>
</span>{
  <span class="hljs-keyword">if</span>(htim == &amp;htim1)
  {
    <span class="hljs-keyword">if</span>(!LedTimer--)
    {
        LedTimer = LED_ITV_TIME;
        HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
    }
  }
}
<span class="hljs-comment">/* USER CODE END 4 */</span>
</code></pre>
<h2 id="one-more-thing">One more thing</h2>
<p>&#x4E0A;&#x9762;&#x7684;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x4F53;&#x73B0;&#x4E86;&#x4E00;&#x79CD;&#x601D;&#x7EF4;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5B9A;&#x4E49;&#x4E00;&#x4E2A;<strong>Timer</strong>&#x7528;&#x4E8E;&#x5012;&#x8BA1;&#x65F6;&#xFF0C;&#x5F53;&#x5012;&#x8BA1;&#x65F6;&#x7ED3;&#x675F;&#x65F6;&#x4EE5;&#x8BBE;&#x5B9A;&#x597D;&#x7684;&#x8FD0;&#x884C;&#x95F4;&#x9694;&#x65F6;&#x95F4;&#x5B8F;&#x5B9A;&#x4E49;<strong>LED_ITV_TIME</strong>&#x91CD;&#x65B0;&#x5F00;&#x59CB;&#x5012;&#x8BA1;&#x65F6;&#xFF0C;&#x5E76;&#x8FD0;&#x884C;&#x76F8;&#x5E94;&#x7684;&#x51FD;&#x6570;&#x3002;&#x51FD;&#x6570;&#x8FC7;&#x4E8E;&#x6D41;&#x7A0B;&#x8017;&#x65F6;&#x592A;&#x957F;&#x5C31;&#x6539;&#x4E3A;&#x5237;&#x65B0;&#x5BF9;&#x5E94;&#x7684;&#x6807;&#x5FD7;&#x4F4D;&#xFF0C;&#x4E3B;&#x51FD;&#x6570;&#x5224;&#x65AD;&#x5404;&#x4E2A;&#x6807;&#x5FD7;&#x4F4D;&#x6765;&#x8FD0;&#x884C;&#x5404;&#x4E2A;&#x8FDB;&#x7A0B;&#xFF0C;&#x8FD0;&#x884C;&#x7ED3;&#x675F;&#x540E;&#x6E05;&#x9664;&#x6807;&#x5FD7;&#x4F4D;&#x3002;&#x8FD9;&#x6837;&#x4E00;&#x6765;&#x6211;&#x4EEC;&#x5B9E;&#x73B0;&#x4E86;&#x4E00;&#x79CD;&#x53EF;&#x4EE5;&#x201C;&#x5E76;&#x53D1;&#x8FD0;&#x884C;&#x201D;&#x591A;&#x4E2A;&#x51FD;&#x6570;&#x7684;&#x7A0B;&#x5E8F;&#x3002;</p>
<p><strong>&#x4EE5;5ms&#x8FD0;&#x884C;&#x4E00;&#x6B21;&#x6309;&#x952E;&#x7A0B;&#x5E8F;&#x548C;125ms&#x8FD0;&#x884C;&#x4E00;&#x6B21;led&#x63A7;&#x5236;&#x4E3A;&#x4F8B;&#xFF1A;</strong></p>
<h3 id="&#x5934;&#x6587;&#x4EF6;&#x548C;&#x5B8F;&#x5B9A;&#x4E49;&#x914D;&#x7F6E;">&#x5934;&#x6587;&#x4EF6;&#x548C;&#x5B8F;&#x5B9A;&#x4E49;&#x914D;&#x7F6E;</h3>
<p>&#x5F15;&#x5165;&#x4E4B;&#x524D;&#x8BFE;&#x7A0B;&#x5F04;&#x7684;<code>led.h</code>&#x548C;&#x591A;&#x529F;&#x80FD;&#x6309;&#x952E;<code>&quot;multi_button.h&quot;</code>&#xFF1A;</p>
<pre><code class="lang-c"><span class="hljs-comment">/* USER CODE BEGIN Includes */</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-string">&quot;led.h&quot;</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-string">&quot;multi_button.h&quot;</span></span>
<span class="hljs-comment">/* USER CODE END Includes */</span>
</code></pre>
<h3 id="&#x6DFB;&#x52A0;&#x521D;&#x59CB;&#x5316;&#x8BED;&#x53E5;">&#x6DFB;&#x52A0;&#x521D;&#x59CB;&#x5316;&#x8BED;&#x53E5;</h3>
<p>&#x5728;<code>main()</code>&#x51FD;&#x6570;&#x4E0A;&#x65B9;&#x6DFB;&#x52A0;&#x8FD0;&#x884C;&#x6807;&#x5FD7;&#x548C;&#x591A;&#x529F;&#x80FD;&#x6309;&#x952E;&#x7684;&#x8BFB;&#x53D6;&#x51FD;&#x6570;&#x548C;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#xFF1A;</p>
<pre><code class="lang-c"><span class="hljs-comment">/* USER CODE BEGIN PM */</span>
<span class="hljs-keyword">static</span> <span class="hljs-keyword">uint8_t</span> LedRun = <span class="hljs-number">0</span>, KeyRun = <span class="hljs-number">0</span>;

<span class="hljs-keyword">struct</span> Button Button1;

<span class="hljs-keyword">uint8_t</span> read_button1_GPIO()
{
  <span class="hljs-keyword">return</span> HAL_GPIO_ReadPin(KEY_GPIO_Port, KEY_Pin);
}

<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">button_callback</span><span class="hljs-params">(<span class="hljs-keyword">void</span> *button)</span>
</span>{
  <span class="hljs-keyword">uint32_t</span> btn_event_val;
  btn_event_val = get_button_event((<span class="hljs-keyword">struct</span> Button *)button);
  <span class="hljs-keyword">switch</span> (btn_event_val)
  {
  <span class="hljs-keyword">case</span> SINGLE_CLICK:
    LedStates = <span class="hljs-number">0x0F</span>;
    <span class="hljs-keyword">break</span>;
  <span class="hljs-keyword">case</span> DOUBLE_CLICK:
    LedStates = <span class="hljs-number">0x33</span>;
    <span class="hljs-keyword">break</span>;
  <span class="hljs-keyword">case</span> LONG_PRESS_HOLD:
    LedStates = <span class="hljs-number">0xAA</span>;
    <span class="hljs-keyword">break</span>;
  }
}
<span class="hljs-comment">/* USER CODE END PM */</span>
</code></pre>
<p>&#x5728;<code>while(1)</code>&#x5FAA;&#x73AF;&#x5F00;&#x59CB;&#x524D;&#x6DFB;&#x52A0;&#x4EE5;&#x4E0B;&#x521D;&#x59CB;&#x5316;&#x914D;&#x7F6E;&#xFF1A;</p>
<pre><code class="lang-c">  <span class="hljs-comment">/* USER CODE BEGIN 2 */</span>
  LedStates = <span class="hljs-number">0xFF</span> - <span class="hljs-number">0x05</span>;
  button_init(&amp;Button1, read_button1_GPIO, <span class="hljs-number">1</span>);
  button_attach(&amp;Button1, SINGLE_CLICK, button_callback);
  button_attach(&amp;Button1, DOUBLE_CLICK, button_callback);
  button_attach(&amp;Button1, LONG_PRESS_HOLD, button_callback);
  button_start(&amp;Button1);
  HAL_TIM_Base_Start_IT(&amp;htim1);
  <span class="hljs-comment">/* USER CODE END 2 */</span>
</code></pre>
<h3 id="&#x7A0B;&#x5E8F;&#x8BED;&#x53E5;&#x4FEE;&#x6539;">&#x7A0B;&#x5E8F;&#x8BED;&#x53E5;&#x4FEE;&#x6539;</h3>
<p>&#x5047;&#x5B9A;&#x5404;&#x4E2A;&#x4E2D;&#x65AD;&#x7A0B;&#x5E8F;&#x53CA;&#x65F6;&#x76F8;&#x5E94;&#xFF0C;&#x6211;&#x4EEC;&#x66F4;&#x6539;<code>Led_Tick()</code>&#x51FD;&#x6570;&#xFF1A;</p>
<pre><code class="lang-c"><span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">Led_Tick</span><span class="hljs-params">(<span class="hljs-keyword">void</span>)</span>
</span>{
    <span class="hljs-keyword">static</span> <span class="hljs-keyword">uint8_t</span> ledTimer = <span class="hljs-number">0</span>;
    ledTimer++;
    <span class="hljs-keyword">if</span>(ledTimer &gt; <span class="hljs-number">7</span>) ledTimer = <span class="hljs-number">0</span>;
    HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, ((LedStates &gt;&gt; ledTimer) &amp; <span class="hljs-number">1</span>));
}
</code></pre>
<p>&#x5728;<code>while(1)</code>&#x6DFB;&#x52A0;&#x6807;&#x5FD7;&#x4F4D;&#x5224;&#x65AD;&#x3001;&#x6267;&#x884C;&#x3001;&#x6E05;&#x9664;&#x6807;&#x5FD7;&#x4F4D;&#x7B49;&#x8BED;&#x53E5;</p>
<pre><code class="lang-c">  <span class="hljs-comment">/* USER CODE BEGIN WHILE */</span>
  <span class="hljs-keyword">while</span> (<span class="hljs-number">1</span>)
  {
    <span class="hljs-keyword">if</span>(LedRun)
    {
      Led_Tick();
      LedRun = <span class="hljs-number">0</span>;
    }
    <span class="hljs-keyword">if</span>(KeyRun)
    {
      button_ticks();
      KeyRun = <span class="hljs-number">0</span>;
    }
    <span class="hljs-comment">/* USER CODE END WHILE */</span>
</code></pre>
<p>&#x5728;&#x5B9A;&#x65F6;&#x5668;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x90A3;&#x53EA;&#x505A;&#x6807;&#x5FD7;&#x4F4D;&#x5224;&#x65AD;&#xFF1A;</p>
<pre><code class="lang-c"><span class="hljs-comment">/* USER CODE BEGIN 4 */</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> LED_ITV_TIME 125</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> KEY_ITV_TIME 5</span>
<span class="hljs-keyword">static</span> <span class="hljs-keyword">uint16_t</span> LedTimer = LED_ITV_TIME;
<span class="hljs-keyword">static</span> <span class="hljs-keyword">uint16_t</span> KeyTimer = KEY_ITV_TIME;
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">HAL_TIM_PeriodElapsedCallback</span><span class="hljs-params">(TIM_HandleTypeDef *htim)</span>
</span>{
  <span class="hljs-keyword">if</span>(htim == &amp;htim1)
  {
    <span class="hljs-keyword">if</span>(!LedTimer--)
    {
        LedTimer = LED_ITV_TIME;
        LedRun = <span class="hljs-number">1</span>;
    }
    <span class="hljs-keyword">if</span>(!KeyTimer--)
    {
        KeyTimer = KEY_ITV_TIME;
        KeyRun = <span class="hljs-number">1</span>;
    }
  }
}
<span class="hljs-comment">/* USER CODE END 4 */</span>
</code></pre>
<h3 id="&#x7F16;&#x8BD1;&#x4E0B;&#x8F7D;">&#x7F16;&#x8BD1;&#x4E0B;&#x8F7D;</h3>
<p>&#x7F16;&#x8BD1;&#x901A;&#x8FC7;&#x4E0B;&#x8F7D;&#x540E;&#xFF0C;&#x7A0B;&#x5E8F;&#x529F;&#x80FD;&#x548C;&#x76F4;&#x63A5;&#x5728;&#x4E3B;&#x51FD;&#x6570;&#x4E2D;&#x8C03;&#x7528;&#x6CA1;&#x6709;&#x592A;&#x5927;&#x5DEE;&#x522B;&#xFF0C;&#x4F46;&#x662F;&#x6CA1;&#x6709;&#x5EF6;&#x65F6;&#x51FD;&#x6570;&#x7684;&#x4ECB;&#x5165;&#xFF0C;&#x8FD9;&#x79CD;&#x901A;&#x8FC7;&#x5B9A;&#x65F6;&#x5668;&#x5237;&#x65B0;&#x6807;&#x5FD7;&#x4F4D;&#x5B9A;&#x65F6;&#x8FD0;&#x884C;&#x7A0B;&#x5E8F;&#x7684;&#x65B9;&#x5F0F;&#x6211;&#x4EEC;&#x79F0;&#x4E3A;&#xFF1A;<strong>&#x65F6;&#x95F4;&#x7247;&#x8C03;&#x5EA6;</strong>&#x3002;&#x5F53;&#x7136;&#xFF0C;&#x5B9E;&#x9645;&#x5E94;&#x7528;&#x4E2D;&#x4EE3;&#x7801;&#x4F1A;&#x7531;&#x7ED3;&#x6784;&#x4F53;&#x5C01;&#x88C5;&#xFF0C;&#x6574;&#x4F53;&#x66F4;&#x52A0;&#x7B80;&#x6D01;&#x6613;&#x7528;&#xFF0C;&#x5177;&#x4F53;&#x53EF;&#x53C2;&#x8003;<a href="../&#x5176;&#x4ED6;&#x4EE3;&#x7801;&#x6574;&#x5408;&#x642C;&#x8FD0;/&#x65F6;&#x95F4;&#x7247;&#x8C03;&#x5EA6;.html">&#x65F6;&#x95F4;&#x7247;&#x8C03;&#x5EA6;</a></p>
 
          </section>
          
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>
 
        </div>
      </div>
      
    </div>

     
    <a
      href="./"
      class="
        navigation navigation-prev
        
      "
      aria-label="Previous page: STM32定时器"
    >
      <i class="fa fa-angle-left"></i>
    </a>
     
    <a
      href="硬件PWM输出.html"
      class="
        navigation navigation-next
        
      "
      aria-label="Next page: 硬件PWM输出"
    >
      <i class="fa fa-angle-right"></i>
    </a>
      
  </div>
  <script>
    function showModal() {
      document.getElementsByClassName("mask")[0].style.display = "block";
      document.getElementsByClassName("donate-modal")[0].style.display =
        "block";
    }
    // 切换赞赏码
    function showDonateImg(num) {
      let alipay = "";
      let wxpay = ""
      if(num){
        wxpay = "hidden"
      }else{
        alipay = "hidden"
      }
      document.getElementById("wxpay-code").hidden = wxpay;
      document.getElementById("alipay-code").hidden = alipay;
      document.getElementsByName("pay-way")[num].checked = "checked";
    }

    // 关闭赞赏框
    function closeDonateModal() {
      document.getElementsByClassName("mask")[0].style.display = "none";
      document.getElementsByClassName("donate-modal")[0].style.display = "none";
    }

    var gitbook = gitbook || [];
    gitbook.push(function () {
      gitbook.page.hasChanged({"page":{"title":"定时器简单中断程序","level":"1.5.1","depth":2,"next":{"title":"硬件PWM输出","level":"1.5.2","depth":2,"path":"STM32定时器/硬件PWM输出.md","ref":"./STM32定时器/硬件PWM输出.md","articles":[]},"previous":{"title":"STM32定时器","level":"1.5","depth":1,"path":"STM32定时器/README.md","ref":"./STM32定时器/README.md","articles":[{"title":"定时器简单中断程序","level":"1.5.1","depth":2,"path":"STM32定时器/定时器简单中断程序.md","ref":"./STM32定时器/定时器简单中断程序.md","articles":[]},{"title":"硬件PWM输出","level":"1.5.2","depth":2,"path":"STM32定时器/硬件PWM输出.md","ref":"./STM32定时器/硬件PWM输出.md","articles":[]},{"title":"DMA输出PWM控制WS2812","level":"1.5.3","depth":2,"path":"STM32定时器/DMA输出PWM控制WS2812.md","ref":"./STM32定时器/DMA输出PWM控制WS2812.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["-lunr","-sharing","-search","-favicon","-code","expandable-chapters","theme-lou","back-to-top-button","search-pro","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"search-pro":{},"code":{"copyButtons":true},"theme-lou":{"hide-elements":[".summary .gitbook-link"],"color":"#8abcd1","copyright":{"author":"Atonidas"},"forbidCopy":false,"logo":"assets/logo.png","search-placeholder":"查找关键内容","copyrightLogo":"assets/copyright.png","favicon":"assets/favicon.ico","autoNumber":3},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"back-to-top-button":{},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{}},"theme":"default","author":"Atonidas","lang":"zh-cn","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{"themeLou":{"nav":[{"target":"_blank","url":"https://Gitee.com/atonidas","name":"Gitee"}]}},"title":"STM32HAL系列教程","gitbook":"*","description":"Gitbook电子书示例项目"},"file":{"path":"STM32定时器/定时器简单中断程序.md","mtime":"2023-04-04T06:18:13.075Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2023-09-13T00:50:24.020Z"},"basePath":"..","book":{"language":""}});
    });
  </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-lou/lou.js"></script>
        
    

    </body>
</html>

